package com.mi.global.shop.common.bean;

import android.graphics.Bitmap;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 // type:
 //	0: 文本
 // 1: 图片
 {
 "title": "我是标题",
 "url": "https://www.mi.com/",
 "data": [
 {"type": 0, "content": "文本"},
 {"type": 1, "content": "http..."}
 ],
 "icon_url": "http://res.ittianyu.com/mi_logo.png"
 }
 */
public class CustomNotificationContent {
    private String title;
    private String url;// click to show
    private List<Data> data;
    @SerializedName("icon_url")
    private String iconUrl;

    public static class Data {
        public static final int TEXT = 0;
        public static final int IMAGE = 1;

        private int type;// 0: 文本, 1: 图片
        private String content;

        // used for save info
        private boolean completed;// if all data load completed, send notification
        private Bitmap bitmap;

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public boolean isCompleted() {
            return completed;
        }

        public void setCompleted(boolean completed) {
            this.completed = completed;
        }

        public Bitmap getBitmap() {
            return bitmap;
        }

        public void setBitmap(Bitmap bitmap) {
            this.bitmap = bitmap;
        }

        @Override
        public String toString() {
            return "Data{" +
                    "type=" + type +
                    ", content='" + content + '\'' +
                    '}';
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<Data> getData() {
        return data;
    }

    public void setData(List<Data> data) {
        this.data = data;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    @Override
    public String toString() {
        return "CustomNotificationContent{" +
                "title='" + title + '\'' +
                ", url='" + url + '\'' +
                ", data=" + data +
                ", iconUrl='" + iconUrl + '\'' +
                '}';
    }
}
